Integrand size = 33, antiderivative size = 277 \[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=-\frac {a^2 (A (3+n)+B (4+n)) \cos (e+f x) (d \sin (e+f x))^{1+n}}{d f (2+n) (3+n)}+\frac {a^2 (2 B (1+n)+A (3+2 n)) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+n}{2},\frac {3+n}{2},\sin ^2(e+f x)\right ) (d \sin (e+f x))^{1+n}}{d f (1+n) (2+n) \sqrt {\cos ^2(e+f x)}}+\frac {a^2 (2 A (3+n)+B (5+2 n)) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+n}{2},\frac {4+n}{2},\sin ^2(e+f x)\right ) (d \sin (e+f x))^{2+n}}{d^2 f (2+n) (3+n) \sqrt {\cos ^2(e+f x)}}-\frac {B \cos (e+f x) (d \sin (e+f x))^{1+n} \left (a^2+a^2 \sin (e+f x)\right )}{d f (3+n)} \]
-a^2*(A*(3+n)+B*(4+n))*cos(f*x+e)*(d*sin(f*x+e))^(1+n)/d/f/(2+n)/(3+n)-B*c os(f*x+e)*(d*sin(f*x+e))^(1+n)*(a^2+a^2*sin(f*x+e))/d/f/(3+n)+a^2*(2*B*(1+ n)+A*(3+2*n))*cos(f*x+e)*hypergeom([1/2, 1/2+1/2*n],[3/2+1/2*n],sin(f*x+e) ^2)*(d*sin(f*x+e))^(1+n)/d/f/(1+n)/(2+n)/(cos(f*x+e)^2)^(1/2)+a^2*(2*A*(3+ n)+B*(5+2*n))*cos(f*x+e)*hypergeom([1/2, 1+1/2*n],[1/2*n+2],sin(f*x+e)^2)* (d*sin(f*x+e))^(2+n)/d^2/f/(2+n)/(3+n)/(cos(f*x+e)^2)^(1/2)
Time = 0.98 (sec) , antiderivative size = 204, normalized size of antiderivative = 0.74 \[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=\frac {a^2 \cos (e+f x) \sin (e+f x) (d \sin (e+f x))^n \left (\frac {A \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+n}{2},\frac {3+n}{2},\sin ^2(e+f x)\right )}{1+n}+\sin (e+f x) \left (\frac {(2 A+B) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2+n}{2},\frac {4+n}{2},\sin ^2(e+f x)\right )}{2+n}+\sin (e+f x) \left (\frac {(A+2 B) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+n}{2},\frac {5+n}{2},\sin ^2(e+f x)\right )}{3+n}+\frac {B \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\sin ^2(e+f x)\right ) \sin (e+f x)}{4+n}\right )\right )\right )}{f \sqrt {\cos ^2(e+f x)}} \]
(a^2*Cos[e + f*x]*Sin[e + f*x]*(d*Sin[e + f*x])^n*((A*Hypergeometric2F1[1/ 2, (1 + n)/2, (3 + n)/2, Sin[e + f*x]^2])/(1 + n) + Sin[e + f*x]*(((2*A + B)*Hypergeometric2F1[1/2, (2 + n)/2, (4 + n)/2, Sin[e + f*x]^2])/(2 + n) + Sin[e + f*x]*(((A + 2*B)*Hypergeometric2F1[1/2, (3 + n)/2, (5 + n)/2, Sin [e + f*x]^2])/(3 + n) + (B*Hypergeometric2F1[1/2, (4 + n)/2, (6 + n)/2, Si n[e + f*x]^2]*Sin[e + f*x])/(4 + n)))))/(f*Sqrt[Cos[e + f*x]^2])
Time = 1.11 (sec) , antiderivative size = 272, normalized size of antiderivative = 0.98, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.303, Rules used = {3042, 3455, 3042, 3447, 3042, 3502, 3042, 3227, 3042, 3122}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \sin (e+f x)+a)^2 (A+B \sin (e+f x)) (d \sin (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \sin (e+f x)+a)^2 (A+B \sin (e+f x)) (d \sin (e+f x))^ndx\) |
\(\Big \downarrow \) 3455 |
\(\displaystyle \frac {\int (d \sin (e+f x))^n (\sin (e+f x) a+a) (a d (B (n+1)+A (n+3))+a d (A (n+3)+B (n+4)) \sin (e+f x))dx}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (d \sin (e+f x))^n (\sin (e+f x) a+a) (a d (B (n+1)+A (n+3))+a d (A (n+3)+B (n+4)) \sin (e+f x))dx}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3447 |
\(\displaystyle \frac {\int (d \sin (e+f x))^n \left (d (A (n+3)+B (n+4)) \sin ^2(e+f x) a^2+d (B (n+1)+A (n+3)) a^2+\left (d (B (n+1)+A (n+3)) a^2+d (A (n+3)+B (n+4)) a^2\right ) \sin (e+f x)\right )dx}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (d \sin (e+f x))^n \left (d (A (n+3)+B (n+4)) \sin (e+f x)^2 a^2+d (B (n+1)+A (n+3)) a^2+\left (d (B (n+1)+A (n+3)) a^2+d (A (n+3)+B (n+4)) a^2\right ) \sin (e+f x)\right )dx}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {\frac {\int (d \sin (e+f x))^n \left (a^2 (n+3) (2 B (n+1)+A (2 n+3)) d^2+a^2 (n+2) (2 A (n+3)+B (2 n+5)) \sin (e+f x) d^2\right )dx}{d (n+2)}-\frac {a^2 (A (n+3)+B (n+4)) \cos (e+f x) (d \sin (e+f x))^{n+1}}{f (n+2)}}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int (d \sin (e+f x))^n \left (a^2 (n+3) (2 B (n+1)+A (2 n+3)) d^2+a^2 (n+2) (2 A (n+3)+B (2 n+5)) \sin (e+f x) d^2\right )dx}{d (n+2)}-\frac {a^2 (A (n+3)+B (n+4)) \cos (e+f x) (d \sin (e+f x))^{n+1}}{f (n+2)}}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {\frac {a^2 d^2 (n+3) (A (2 n+3)+2 B (n+1)) \int (d \sin (e+f x))^ndx+a^2 d (n+2) (2 A (n+3)+B (2 n+5)) \int (d \sin (e+f x))^{n+1}dx}{d (n+2)}-\frac {a^2 (A (n+3)+B (n+4)) \cos (e+f x) (d \sin (e+f x))^{n+1}}{f (n+2)}}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a^2 d^2 (n+3) (A (2 n+3)+2 B (n+1)) \int (d \sin (e+f x))^ndx+a^2 d (n+2) (2 A (n+3)+B (2 n+5)) \int (d \sin (e+f x))^{n+1}dx}{d (n+2)}-\frac {a^2 (A (n+3)+B (n+4)) \cos (e+f x) (d \sin (e+f x))^{n+1}}{f (n+2)}}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle \frac {\frac {\frac {a^2 d (n+3) (A (2 n+3)+2 B (n+1)) \cos (e+f x) (d \sin (e+f x))^{n+1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+1}{2},\frac {n+3}{2},\sin ^2(e+f x)\right )}{f (n+1) \sqrt {\cos ^2(e+f x)}}+\frac {a^2 (2 A (n+3)+B (2 n+5)) \cos (e+f x) (d \sin (e+f x))^{n+2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+2}{2},\frac {n+4}{2},\sin ^2(e+f x)\right )}{f \sqrt {\cos ^2(e+f x)}}}{d (n+2)}-\frac {a^2 (A (n+3)+B (n+4)) \cos (e+f x) (d \sin (e+f x))^{n+1}}{f (n+2)}}{d (n+3)}-\frac {B \cos (e+f x) \left (a^2 \sin (e+f x)+a^2\right ) (d \sin (e+f x))^{n+1}}{d f (n+3)}\) |
-((B*Cos[e + f*x]*(d*Sin[e + f*x])^(1 + n)*(a^2 + a^2*Sin[e + f*x]))/(d*f* (3 + n))) + (-((a^2*(A*(3 + n) + B*(4 + n))*Cos[e + f*x]*(d*Sin[e + f*x])^ (1 + n))/(f*(2 + n))) + ((a^2*d*(3 + n)*(2*B*(1 + n) + A*(3 + 2*n))*Cos[e + f*x]*Hypergeometric2F1[1/2, (1 + n)/2, (3 + n)/2, Sin[e + f*x]^2]*(d*Sin [e + f*x])^(1 + n))/(f*(1 + n)*Sqrt[Cos[e + f*x]^2]) + (a^2*(2*A*(3 + n) + B*(5 + 2*n))*Cos[e + f*x]*Hypergeometric2F1[1/2, (2 + n)/2, (4 + n)/2, Si n[e + f*x]^2]*(d*Sin[e + f*x])^(2 + n))/(f*Sqrt[Cos[e + f*x]^2]))/(d*(2 + n)))/(d*(3 + n))
3.1.2.3.1 Defintions of rubi rules used
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[2*n]
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[(-b)*B*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 1)*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(m + n + 1))), x] + Simp[1/(d*(m + n + 1)) Int[(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^n*Simp[a*A*d*(m + n + 1) + B*(a*c*(m - 1 ) + b*d*(n + 1)) + (A*b*d*(m + n + 1) - B*(b*c*m - a*d*(2*m + n)))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1/2] && !LtQ[n, -1 ] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
\[\int \left (d \sin \left (f x +e \right )\right )^{n} \left (a +a \sin \left (f x +e \right )\right )^{2} \left (A +B \sin \left (f x +e \right )\right )d x\]
\[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=\int { {\left (B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (d \sin \left (f x + e\right )\right )^{n} \,d x } \]
integral(-((A + 2*B)*a^2*cos(f*x + e)^2 - 2*(A + B)*a^2 + (B*a^2*cos(f*x + e)^2 - 2*(A + B)*a^2)*sin(f*x + e))*(d*sin(f*x + e))^n, x)
Timed out. \[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=\text {Timed out} \]
\[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=\int { {\left (B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (d \sin \left (f x + e\right )\right )^{n} \,d x } \]
\[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=\int { {\left (B \sin \left (f x + e\right ) + A\right )} {\left (a \sin \left (f x + e\right ) + a\right )}^{2} \left (d \sin \left (f x + e\right )\right )^{n} \,d x } \]
Timed out. \[ \int (d \sin (e+f x))^n (a+a \sin (e+f x))^2 (A+B \sin (e+f x)) \, dx=\int {\left (d\,\sin \left (e+f\,x\right )\right )}^n\,\left (A+B\,\sin \left (e+f\,x\right )\right )\,{\left (a+a\,\sin \left (e+f\,x\right )\right )}^2 \,d x \]